FROM registry.cn-hangzhou.aliyuncs.com/riscv64_hzc/ubuntu:25.04
MAINTAINER marc@slintes.net
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt update && apt -y install \
    nfs-ganesha nfs-ganesha-vfs \
    nfs-common rpcbind && \
    # Clean cache
    apt -y clean all

# Add Tini
ENV TINI_VERSION v0.16.1
ADD https://gitee.com/huang_a/tini/releases/download/${TINI_VERSION}/tini-riscv64 /tini
RUN set -x \
    && chmod +x /tini \
    && mkdir /var/run/ganesha

COPY rootfs /

VOLUME ["/data/nfs"]

# NFS ports
EXPOSE 111 111/udp 662 2049 38465-38467

ENTRYPOINT ["/tini", "--"]
CMD ["/opt/start_nfs.sh"]
